package com.devhelper.examples.gef.figure;

import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.draw2d.geometry.Rectangle;

public class EnterpriseFigure extends Figure {
    private Label lblName = new Label();
    private Label lblAddress = new Label();

    private XYLayout layout;

    public EnterpriseFigure() {
        layout = new XYLayout();
        setLayoutManager(layout);

        add(lblName, new Rectangle(5, 5, -1, -1));
        add(lblAddress, new Rectangle(5, 17, -1, -1));

        setBorder(new LineBorder(5));
    }

    public void setLayout(Rectangle rect) {
        setBounds(rect);
    }

    public void setName(String name) {
        lblName.setText(name);
    }

    public void setAddress(String address) {
        lblAddress.setText(address);
    }
}
